package sip;

import java.awt.CardLayout;
//import Akanksha.*;
//import javax.swing.JComboBox;
//import javax.swing.DefaultComboBoxModel;
//import javax.swing.MutableComboBoxModel;
//import java.util.ArrayList;
//import java.applet.*;
//import java.awt.*;

/**
 *
 * @author arianareyessantiago
 */

public class SimpleInsulinPumpUI extends javax.swing.JFrame {

    /**
     * Creates new form SimpleInsulinPumpUI
     */
    private static int count =1;
    
    public SimpleInsulinPumpUI() {
        initComponents();
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        mainPanel = new javax.swing.JPanel();
        mainScreen = new javax.swing.JPanel();
        basalButton = new javax.swing.JButton();
        bolusButton = new javax.swing.JButton();
        primeButton = new javax.swing.JButton();
        optionsButton = new javax.swing.JButton();
        historyButton = new javax.swing.JButton();
        mainMenuLabel = new javax.swing.JLabel();
        bolusScreen = new javax.swing.JPanel();
        labelBolus = new javax.swing.JLabel();
        foodComboBox = new javax.swing.JComboBox();
        subFoodComboBox = new javax.swing.JComboBox();
        carbComboBox = new javax.swing.JComboBox();
        foodLabel = new javax.swing.JLabel();
        totalTextField = new javax.swing.JTextField();
        totalLabel = new javax.swing.JLabel();
        addButton2 = new javax.swing.JButton();
        addButton1 = new javax.swing.JButton();
        carbLabel = new javax.swing.JLabel();
        backBolusButton = new javax.swing.JButton();
        bolusScrollPane = new javax.swing.JScrollPane();
        bolusTextArea = new javax.swing.JTextArea();
        gLabel = new javax.swing.JLabel();
        okBolusButton = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        insulinUnitsBolusTextField = new javax.swing.JTextField();
        basalActivationScreen = new javax.swing.JPanel();
        basalActivationLabel = new javax.swing.JLabel();
        profileNameComboBox = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        activateBasalActivationButton = new javax.swing.JButton();
        backBasalActivationButton = new javax.swing.JButton();
        addProfileButton = new javax.swing.JButton();
        basalScreen = new javax.swing.JPanel();
        basalLabel = new javax.swing.JLabel();
        insulinUnitsComboBox = new javax.swing.JComboBox();
        unitsOfInsulinLabel = new javax.swing.JLabel();
        profileNameTextField = new javax.swing.JTextField();
        profileNameLabel = new javax.swing.JLabel();
        activateBasalButton = new javax.swing.JButton();
        backBasalButton = new javax.swing.JButton();
        saveBasalButton = new javax.swing.JButton();
        nextButton = new javax.swing.JButton();
        timeFrameLabel = new javax.swing.JLabel();
        timeFrameComboBox = new javax.swing.JComboBox();
        upperPanel = new javax.swing.JPanel();
        timeTextField = new javax.swing.JTextField();
        batteryTextField = new javax.swing.JTextField();
        insulinTextField = new javax.swing.JTextField();
        lowerPanel = new javax.swing.JPanel();
        bgTargetLabel = new javax.swing.JLabel();
        bgTargetTextField = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        mainPanel.setLayout(new java.awt.CardLayout());

        mainScreen.setBackground(javax.swing.UIManager.getDefaults().getColor("Desktop.background"));
        mainScreen.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        mainScreen.setForeground(javax.swing.UIManager.getDefaults().getColor("Desktop.background"));
        mainScreen.setPreferredSize(new java.awt.Dimension(500, 240));

        basalButton.setBackground(javax.swing.UIManager.getDefaults().getColor("Desktop.background"));
        basalButton.setFont(new java.awt.Font("Lucida Grande", 1, 14)); // NOI18N
        basalButton.setText("Basal ");
        basalButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        basalButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                basalButtonActionPerformed(evt);
            }
        });

        bolusButton.setBackground(javax.swing.UIManager.getDefaults().getColor("CheckBoxMenuItem.selectionBackground"));
        bolusButton.setFont(new java.awt.Font("Lucida Grande", 1, 14)); // NOI18N
        bolusButton.setText("Bolus");
        bolusButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        bolusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bolusButtonActionPerformed(evt);
            }
        });
        bolusButton.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                bolusButtonKeyPressed(evt);
            }
        });

        primeButton.setFont(new java.awt.Font("Lucida Grande", 1, 14)); // NOI18N
        primeButton.setText("Options");
        primeButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));

        optionsButton.setFont(new java.awt.Font("Lucida Grande", 1, 14)); // NOI18N
        optionsButton.setText("Prime");
        optionsButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));

        historyButton.setFont(new java.awt.Font("Lucida Grande", 1, 14)); // NOI18N
        historyButton.setText("History");
        historyButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));

        mainMenuLabel.setFont(new java.awt.Font("Lucida Grande", 1, 14)); // NOI18N
        mainMenuLabel.setText("Main Menu");

        org.jdesktop.layout.GroupLayout mainScreenLayout = new org.jdesktop.layout.GroupLayout(mainScreen);
        mainScreen.setLayout(mainScreenLayout);
        mainScreenLayout.setHorizontalGroup(
            mainScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(mainScreenLayout.createSequentialGroup()
                .addContainerGap()
                .add(mainScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(primeButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(optionsButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(bolusButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(basalButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(historyButton, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .add(0, 432, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, mainScreenLayout.createSequentialGroup()
                .addContainerGap(458, Short.MAX_VALUE)
                .add(mainMenuLabel)
                .addContainerGap())
        );
        mainScreenLayout.setVerticalGroup(
            mainScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(mainScreenLayout.createSequentialGroup()
                .addContainerGap()
                .add(mainMenuLabel)
                .add(23, 23, 23)
                .add(basalButton)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(bolusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(optionsButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(primeButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(historyButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(98, Short.MAX_VALUE))
        );

        mainPanel.add(mainScreen, "card2");

        bolusScreen.setBackground(javax.swing.UIManager.getDefaults().getColor("Desktop.background"));
        bolusScreen.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        bolusScreen.setPreferredSize(new java.awt.Dimension(500, 240));

        labelBolus.setFont(new java.awt.Font("Lucida Grande", 1, 14)); // NOI18N
        labelBolus.setText("BOLUS");

        foodComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String [] {"Select", "Breakfast", "Meat", "Fish", "Snacks", "Juices"}));
        foodComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                foodComboBoxActionPerformed(evt);
            }
        });

        subFoodComboBox.setVerifyInputWhenFocusTarget(false);

        carbComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] {"1", "2","3", "4", "5", "6","7", "8", "9", "10", "20", "30", "40", "50" }));
        carbComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                carbComboBoxActionPerformed(evt);
            }
        });

        foodLabel.setText("Food");

        totalLabel.setText("Total");

        addButton2.setText("ADD");
        addButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addButton2ActionPerformed(evt);
            }
        });

        addButton1.setText("ADD");
        addButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addButton1ActionPerformed(evt);
            }
        });

        carbLabel.setText("Carbs");

        backBolusButton.setText("Back");
        backBolusButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backBolusButtonActionPerformed(evt);
            }
        });

        bolusTextArea.setColumns(20);
        bolusTextArea.setRows(5);
        bolusScrollPane.setViewportView(bolusTextArea);

        gLabel.setText("g");

        okBolusButton.setText("OK");

        jLabel1.setText("Insulin Units ");

        insulinUnitsBolusTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                insulinUnitsBolusTextFieldActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout bolusScreenLayout = new org.jdesktop.layout.GroupLayout(bolusScreen);
        bolusScreen.setLayout(bolusScreenLayout);
        bolusScreenLayout.setHorizontalGroup(
            bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(bolusScreenLayout.createSequentialGroup()
                .addContainerGap()
                .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(bolusScreenLayout.createSequentialGroup()
                        .add(backBolusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(labelBolus)
                        .addContainerGap())
                    .add(bolusScreenLayout.createSequentialGroup()
                        .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(bolusScreenLayout.createSequentialGroup()
                                .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(foodLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(carbLabel)
                                    .add(totalLabel))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(carbComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 102, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(foodComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 102, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(bolusScreenLayout.createSequentialGroup()
                                        .add(totalTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 73, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                        .add(gLabel)
                                        .add(35, 35, 35)
                                        .add(jLabel1)
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                        .add(insulinUnitsBolusTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                                .add(0, 0, Short.MAX_VALUE))
                            .add(bolusScreenLayout.createSequentialGroup()
                                .add(144, 144, 144)
                                .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(subFoodComboBox, 0, 223, Short.MAX_VALUE)
                                    .add(bolusScreenLayout.createSequentialGroup()
                                        .add(addButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                        .add(0, 214, Short.MAX_VALUE)))))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(addButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 54, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(65, 65, 65))
                    .add(bolusScreenLayout.createSequentialGroup()
                        .add(bolusScrollPane)
                        .add(18, 18, 18)
                        .add(okBolusButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 58, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(22, 22, 22))))
        );
        bolusScreenLayout.setVerticalGroup(
            bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(bolusScreenLayout.createSequentialGroup()
                .addContainerGap()
                .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(backBolusButton)
                    .add(labelBolus))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(carbLabel)
                    .add(carbComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(addButton1))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(foodLabel)
                    .add(foodComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(subFoodComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(addButton2))
                .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(bolusScreenLayout.createSequentialGroup()
                        .add(3, 3, 3)
                        .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                .add(jLabel1)
                                .add(insulinUnitsBolusTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(bolusScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                .add(totalLabel)
                                .add(totalTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(gLabel)))
                        .add(12, 12, 12)
                        .add(bolusScrollPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE))
                    .add(bolusScreenLayout.createSequentialGroup()
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(okBolusButton)))
                .addContainerGap())
        );

        mainPanel.add(bolusScreen, "card3");

        basalActivationScreen.setBackground(javax.swing.UIManager.getDefaults().getColor("Desktop.background"));
        basalActivationScreen.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        basalActivationScreen.setName("basalActivationScreen"); // NOI18N
        basalActivationScreen.setPreferredSize(new java.awt.Dimension(500, 240));

        basalActivationLabel.setFont(new java.awt.Font("Lucida Grande", 1, 14)); // NOI18N
        basalActivationLabel.setText(" BASAL ACTIVATION ");

        profileNameComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        profileNameComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                profileNameComboBoxActionPerformed(evt);
            }
        });

        jLabel13.setText("Profile Name");

        activateBasalActivationButton.setText("Activate");
        activateBasalActivationButton.setName("Activate"); // NOI18N
        activateBasalActivationButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                activateBasalActivationButtonActionPerformed(evt);
            }
        });

        backBasalActivationButton.setText("Back");
        backBasalActivationButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backBasalActivationButtonActionPerformed(evt);
            }
        });

        addProfileButton.setText("Add Profile");
        addProfileButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addProfileButtonActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout basalActivationScreenLayout = new org.jdesktop.layout.GroupLayout(basalActivationScreen);
        basalActivationScreen.setLayout(basalActivationScreenLayout);
        basalActivationScreenLayout.setHorizontalGroup(
            basalActivationScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(basalActivationScreenLayout.createSequentialGroup()
                .addContainerGap()
                .add(basalActivationScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(basalActivationScreenLayout.createSequentialGroup()
                        .add(backBasalActivationButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(basalActivationLabel))
                    .add(basalActivationScreenLayout.createSequentialGroup()
                        .add(basalActivationScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(basalActivationScreenLayout.createSequentialGroup()
                                .add(jLabel13)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(profileNameComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(activateBasalActivationButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 317, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(0, 214, Short.MAX_VALUE))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, basalActivationScreenLayout.createSequentialGroup()
                        .add(0, 0, Short.MAX_VALUE)
                        .add(addProfileButton)))
                .addContainerGap())
        );
        basalActivationScreenLayout.setVerticalGroup(
            basalActivationScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(basalActivationScreenLayout.createSequentialGroup()
                .addContainerGap()
                .add(basalActivationScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(backBasalActivationButton)
                    .add(basalActivationLabel))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(basalActivationScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel13, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(profileNameComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(activateBasalActivationButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 43, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(addProfileButton)
                .addContainerGap(92, Short.MAX_VALUE))
        );

        mainPanel.add(basalActivationScreen, "basalActivationScreen");

        basalScreen.setBackground(javax.swing.UIManager.getDefaults().getColor("Desktop.background"));
        basalScreen.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        basalScreen.setName("basalScreen"); // NOI18N

        basalLabel.setFont(new java.awt.Font("Lucida Grande", 1, 14)); // NOI18N
        basalLabel.setText("BASAL");

        insulinUnitsComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String [] {"0.25","0.5","0.75","1.0","1.25","1.5","1.75","2.0","2.25","2.5","2.75","3.0"}));
        insulinUnitsComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                insulinUnitsComboBoxActionPerformed(evt);
            }
        });

        unitsOfInsulinLabel.setText("Units of Insulin");

        profileNameTextField.setText("jTextField9");

        profileNameLabel.setText("Profile Name");

        activateBasalButton.setText("Activate");
        activateBasalButton.setName("Activate"); // NOI18N
        activateBasalButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                activateBasalButtonActionPerformed(evt);
            }
        });

        backBasalButton.setText("Back");
        backBasalButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backBasalButtonActionPerformed(evt);
            }
        });

        saveBasalButton.setLabel("Save");
        saveBasalButton.setName("Save"); // NOI18N
        saveBasalButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveBasalButtonActionPerformed(evt);
            }
        });

        nextButton.setLabel("Next");
        nextButton.setName("Next"); // NOI18N
        nextButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nextButtonActionPerformed(evt);
            }
        });

        timeFrameLabel.setText("Time Frame");

        timeFrameComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String [] {"00-01","01-02","02-03","03-04","04-05","05-06","06-07","07-08","08-09","09-10","10-11","11-12","12-13","13-14","14-15","15-16","16-17","17-18","18-19","19-20","20-21","21-22","22-23","23-00"}));
        timeFrameComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                timeFrameComboBoxActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout basalScreenLayout = new org.jdesktop.layout.GroupLayout(basalScreen);
        basalScreen.setLayout(basalScreenLayout);
        basalScreenLayout.setHorizontalGroup(
            basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(basalScreenLayout.createSequentialGroup()
                .addContainerGap()
                .add(basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(basalScreenLayout.createSequentialGroup()
                        .add(backBasalButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(basalLabel))
                    .add(basalScreenLayout.createSequentialGroup()
                        .add(basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(basalScreenLayout.createSequentialGroup()
                                .add(timeFrameLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 90, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(18, 18, 18)
                                .add(timeFrameComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(nextButton))
                            .add(org.jdesktop.layout.GroupLayout.LEADING, basalScreenLayout.createSequentialGroup()
                                .add(basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(unitsOfInsulinLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 100, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(profileNameLabel))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(profileNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(insulinUnitsComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 207, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                        .add(0, 135, Short.MAX_VALUE))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, basalScreenLayout.createSequentialGroup()
                        .add(saveBasalButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 116, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(activateBasalButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 129, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(14, 14, 14)))
                .addContainerGap())
        );
        basalScreenLayout.setVerticalGroup(
            basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(basalScreenLayout.createSequentialGroup()
                .addContainerGap()
                .add(basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(backBasalButton)
                    .add(basalLabel))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(profileNameLabel)
                    .add(profileNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(unitsOfInsulinLabel)
                    .add(insulinUnitsComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .add(basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(basalScreenLayout.createSequentialGroup()
                        .add(29, 29, 29)
                        .add(basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(timeFrameComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(timeFrameLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(basalScreenLayout.createSequentialGroup()
                        .add(1, 1, 1)
                        .add(nextButton)))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(basalScreenLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(saveBasalButton)
                    .add(activateBasalButton))
                .addContainerGap(70, Short.MAX_VALUE))
        );

        mainPanel.add(basalScreen, "basalScreen");

        upperPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("Desktop.background"));

        timeTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                timeTextFieldActionPerformed(evt);
            }
        });

        batteryTextField.setText("Battery");

        insulinTextField.setText("Insulin");
        insulinTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                insulinTextFieldActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout upperPanelLayout = new org.jdesktop.layout.GroupLayout(upperPanel);
        upperPanel.setLayout(upperPanelLayout);
        upperPanelLayout.setHorizontalGroup(
            upperPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, upperPanelLayout.createSequentialGroup()
                .addContainerGap()
                .add(batteryTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 36, Short.MAX_VALUE)
                .add(insulinTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(87, 87, 87)
                .add(timeTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 90, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        upperPanelLayout.setVerticalGroup(
            upperPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(upperPanelLayout.createSequentialGroup()
                .addContainerGap()
                .add(upperPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(timeTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(batteryTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(insulinTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(8, Short.MAX_VALUE))
        );

        lowerPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("Desktop.background"));

        bgTargetLabel.setText("BG Target:");

        bgTargetTextField.setText("BG Target");

        org.jdesktop.layout.GroupLayout lowerPanelLayout = new org.jdesktop.layout.GroupLayout(lowerPanel);
        lowerPanel.setLayout(lowerPanelLayout);
        lowerPanelLayout.setHorizontalGroup(
            lowerPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, lowerPanelLayout.createSequentialGroup()
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(bgTargetLabel)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(bgTargetTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        lowerPanelLayout.setVerticalGroup(
            lowerPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(lowerPanelLayout.createSequentialGroup()
                .addContainerGap()
                .add(lowerPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(bgTargetTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(bgTargetLabel))
                .addContainerGap(8, Short.MAX_VALUE))
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(0, 11, Short.MAX_VALUE)
                .add(mainPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(0, 1, Short.MAX_VALUE))
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, lowerPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(upperPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(upperPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(mainPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(lowerPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void bolusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bolusButtonActionPerformed

        CardLayout cl = (CardLayout)(mainPanel.getLayout());
        cl.show(mainPanel, "card3");//(mainPanel, "bolusScreen");
        
    }//GEN-LAST:event_bolusButtonActionPerformed

    private void bolusButtonKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_bolusButtonKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_bolusButtonKeyPressed

    private void backBolusButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backBolusButtonActionPerformed

        CardLayout cl = (CardLayout)(mainPanel.getLayout());
        cl.show(mainPanel, "card2");//(mainPanel, "mainScreen")

    }//GEN-LAST:event_backBolusButtonActionPerformed

    private void addButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButton2ActionPerformed
        // TODO add your handling code here:
        String itemOption = (String) subFoodComboBox.getSelectedItem();
        String value = itemOption.split(" g|-- ")[1];
        int i = Integer.parseInt(value);
        bolusTextArea.append(itemOption + "\n");
       
    }//GEN-LAST:event_addButton2ActionPerformed

    private void carbComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_carbComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_carbComboBoxActionPerformed

    private void foodComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_foodComboBoxActionPerformed
        // TODO add your handling code here:
        String [] breakfastArray = {"Cereal -- 5 g", "Bagel -- 15 g", "Toast -- 15 g", "Egg -- 5 g"};
        String [] meatArray = {"Bacon -- 10 g", "Turkey -- 8 g", "Chicken -- 9 g"};
        String [] fishArray = {"Salmon -- 12 g", "Tilapia -- 7 g", "Tuna -- 5 g", "Shrimp -- 9 g"};
        String [] snacksArray = {"Almonds -- 25 g", "Greek Yogurt -- 9 g", "Yogurt -- 8 g", "Apple -- 10 g", "Carrots -- 7 g"};
        String [] juicesArray = {"Apple -- 19 g", "Orange -- 15 g", "Cranberry -- 10 g", "Grape -- 12 g"};
        String itemOption = (String) foodComboBox.getSelectedItem();
        if("Breakfast".equals(itemOption)) {
            subFoodComboBox.setModel(new javax.swing.DefaultComboBoxModel(breakfastArray));
        } else if ("Meat".equals(itemOption)){
            subFoodComboBox.setModel(new javax.swing.DefaultComboBoxModel(meatArray));
        } else if ("Snacks".equals(itemOption)){
            subFoodComboBox.setModel(new javax.swing.DefaultComboBoxModel(snacksArray));
        } else if ("Fish".equals(itemOption)){
            subFoodComboBox.setModel(new javax.swing.DefaultComboBoxModel(fishArray));
        } else if ("Juices".equals(itemOption)){
            subFoodComboBox.setModel(new javax.swing.DefaultComboBoxModel(juicesArray));
        }

    }//GEN-LAST:event_foodComboBoxActionPerformed

    private void insulinTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_insulinTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_insulinTextFieldActionPerformed

    private void profileNameComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_profileNameComboBoxActionPerformed
        // TODO add your handling code here:

    }//GEN-LAST:event_profileNameComboBoxActionPerformed

    private void activateBasalActivationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_activateBasalActivationButtonActionPerformed
        // TODO add your handling code here:

    }//GEN-LAST:event_activateBasalActivationButtonActionPerformed

    private void backBasalActivationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backBasalActivationButtonActionPerformed
        // TODO add your handling code here:
        CardLayout cl = (CardLayout)(mainPanel.getLayout());
        cl.show(mainPanel,"card2");// card2 + mainScreen
    }//GEN-LAST:event_backBasalActivationButtonActionPerformed

    private void addProfileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addProfileButtonActionPerformed
        // TODO add your handling code here:
        CardLayout cl = (CardLayout)(mainPanel.getLayout());
        cl.show(mainPanel,"basalScreen");
    }//GEN-LAST:event_addProfileButtonActionPerformed

    private void basalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_basalButtonActionPerformed
        // TODO add your handling code here:
        CardLayout cl = (CardLayout)(mainPanel.getLayout());
        cl.show(mainPanel, "basalActivationScreen");
    }//GEN-LAST:event_basalButtonActionPerformed

    private void timeFrameComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeFrameComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_timeFrameComboBoxActionPerformed

    private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextButtonActionPerformed
        // TODO add your handling code here:
        BasalProfile basalprofile = new BasalProfile();
        //basalprofile.
        //Saves the basal profile name
        //basalprofile.saveBasalProfileName(jTextField9.getText());
        // saves the basal value into an array using BasalProfile class
        String basalValue = String.valueOf(insulinUnitsComboBox.getSelectedItem());
        Double basalValueDouble = new Double(basalValue);
        //basalprofile.profile[count] = basalValueDouble;
        // increments the counter to input basal value for next hour 
        count ++;
    }//GEN-LAST:event_nextButtonActionPerformed

    private void saveBasalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveBasalButtonActionPerformed
        // TODO add your handling code here:
        // adds the basal profile created to the basal arraylist
        // BasalProfile.basal;
    }//GEN-LAST:event_saveBasalButtonActionPerformed

    private void backBasalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backBasalButtonActionPerformed
        // TODO add your handling code here:
        CardLayout cl = (CardLayout)(mainPanel.getLayout());
        cl.show(mainPanel,"basalActivationScreen");
    }//GEN-LAST:event_backBasalButtonActionPerformed

    private void activateBasalButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_activateBasalButtonActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_activateBasalButtonActionPerformed

    private void insulinUnitsComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_insulinUnitsComboBoxActionPerformed
        // TODO add your handling code here:
        //jComboBox5.setSelectedIndex(count);
    }//GEN-LAST:event_insulinUnitsComboBoxActionPerformed

    private void addButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButton1ActionPerformed
        // TODO add your handling code here:
        String item = (String)carbComboBox.getSelectedItem();
        int totalCarbs = 0;
        int i = Integer.parseInt(item);
        if (okBolusButton.isSelected() == false){
            totalCarbs = totalCarbs + i; 
            String total = Integer.toString(totalCarbs);
            totalTextField.setText(total);
        }
        
        bolusTextArea.append("Carb Input -- "+ totalCarbs +" g\n");
        
    }//GEN-LAST:event_addButton1ActionPerformed

    private void insulinUnitsBolusTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_insulinUnitsBolusTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_insulinUnitsBolusTextFieldActionPerformed

    private void timeTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_timeTextFieldActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(SimpleInsulinPumpUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(SimpleInsulinPumpUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(SimpleInsulinPumpUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(SimpleInsulinPumpUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new SimpleInsulinPumpUI().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton activateBasalActivationButton;
    private javax.swing.JButton activateBasalButton;
    private javax.swing.JButton addButton1;
    private javax.swing.JButton addButton2;
    private javax.swing.JButton addProfileButton;
    private javax.swing.JButton backBasalActivationButton;
    private javax.swing.JButton backBasalButton;
    private javax.swing.JButton backBolusButton;
    private javax.swing.JLabel basalActivationLabel;
    private javax.swing.JPanel basalActivationScreen;
    private javax.swing.JButton basalButton;
    private javax.swing.JLabel basalLabel;
    private javax.swing.JPanel basalScreen;
    private javax.swing.JTextField batteryTextField;
    private javax.swing.JLabel bgTargetLabel;
    private javax.swing.JTextField bgTargetTextField;
    private javax.swing.JButton bolusButton;
    private javax.swing.JPanel bolusScreen;
    private javax.swing.JScrollPane bolusScrollPane;
    private javax.swing.JTextArea bolusTextArea;
    private javax.swing.JComboBox carbComboBox;
    private javax.swing.JLabel carbLabel;
    private javax.swing.JComboBox foodComboBox;
    private javax.swing.JLabel foodLabel;
    private javax.swing.JLabel gLabel;
    private javax.swing.JButton historyButton;
    private javax.swing.JTextField insulinTextField;
    private javax.swing.JTextField insulinUnitsBolusTextField;
    private javax.swing.JComboBox insulinUnitsComboBox;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel labelBolus;
    private javax.swing.JPanel lowerPanel;
    private javax.swing.JLabel mainMenuLabel;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JPanel mainScreen;
    private javax.swing.JButton nextButton;
    private javax.swing.JButton okBolusButton;
    private javax.swing.JButton optionsButton;
    private javax.swing.JButton primeButton;
    private javax.swing.JComboBox profileNameComboBox;
    private javax.swing.JLabel profileNameLabel;
    private javax.swing.JTextField profileNameTextField;
    private javax.swing.JButton saveBasalButton;
    private javax.swing.JComboBox subFoodComboBox;
    private javax.swing.JComboBox timeFrameComboBox;
    private javax.swing.JLabel timeFrameLabel;
    private javax.swing.JTextField timeTextField;
    private javax.swing.JLabel totalLabel;
    private javax.swing.JTextField totalTextField;
    private javax.swing.JLabel unitsOfInsulinLabel;
    private javax.swing.JPanel upperPanel;
    // End of variables declaration//GEN-END:variables
}